FROM python:3.8

ENV PORT=9000
ENV FOLLOW="https://pypi.python.org/simple"
ENV PACKAGES="/mnt/data/packages"
# time zone
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

ADD . /apps
WORKDIR /apps

ENV PATH /usr/local/bin:$PATH
ENV PYTHONPATH "${PYTONPATH}:/apps"

RUN pip3 install pypiserver -i https://pypi.tuna.tsinghua.edu.cn/simple

CMD pypi-server -p $PORT -a . --fallback-url $FOLLOW  -P $PACKAGES

CMD pypi-server run -p 10000 --fallback-url https://pypi.tuna.tsinghua.edu.cn/simple -P /mnt/data/packages